# sk-9f7db31ed3ac4e53b04f51f1fe72f52e
# Please install OpenAI SDK first: `pip3 install openai`

from openai import OpenAI

client = OpenAI(api_key="sk-9f7db31ed3ac4e53b04f51f1fe72f52e", base_url="https://api.deepseek.com")
# 定义变量
user_content = "分析下java和python的区别"
response = client.chat.completions.create(
    model="deepseek-chat",
    messages=[
        {"role": "system", "content": "You are a helpful assistant"},
        {"role": "user", "content": user_content},
    ],
    stream=False
)

print(response.choices[0].message.content)